﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
                    xmlns:rules="clr-namespace:XamlHelpmeet.UI.ValidationRules"
                    xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0">
    <rules:RequiredEntryValidationRule x:Key="requiredEntryValidationRule" />


    <Style TargetType="{x:Type ListView}">
        <Setter Property="Background"
                Value="{DynamicResource {x:Static vsfx:VsBrushes.WindowKey}}" />
        <Setter Property="BorderBrush"
                Value="{DynamicResource {x:Static vsfx:VsBrushes.DockTargetBorderKey}}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Foreground"
                Value="{DynamicResource {x:Static vsfx:VsBrushes.WindowTextKey}}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll"
                Value="true" />
        <Setter Property="ScrollViewer.PanningMode"
                Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled"
                Value="False" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListView}">
                    <Themes:ListBoxChrome x:Name="Bd"
                                          BorderBrush="{TemplateBinding BorderBrush}"
                                          BorderThickness="{TemplateBinding BorderThickness}"
                                          Background="{TemplateBinding Background}"
                                          RenderMouseOver="{TemplateBinding IsMouseOver}"
                                          RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"
                                          SnapsToDevicePixels="true">
                        <ScrollViewer Padding="{TemplateBinding Padding}"
                                      Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </ScrollViewer>
                    </Themes:ListBoxChrome>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Background"
                                    TargetName="Bd"
                                    Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsGrouping"
                                           Value="true" />
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping"
                                           Value="false" />
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll"
                                    Value="false" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="2"
                                           SnapsToDevicePixels="True"
                                           Stroke="{DynamicResource {x:Static vsfx:VsBrushes.ButtonHighlightKey}}"
                                           StrokeDashArray="1 2"
                                           StrokeThickness="1" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ButtonFaceKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ButtonShadowKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ButtonTextKey}}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="True">
                        <ContentPresenter x:Name="contentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Focusable="False"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefaulted" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ButtonHighlightKey}}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonHoverActiveKey}}" />
                            <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonHoverActiveBorderKey}}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownKey}}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownActiveGlyphKey}}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownBorderKey}}" />
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                            <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownKey}}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownActiveGlyphKey}}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownBorderKey}}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveKey}}" />
                            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveBorderKey}}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveGlyphKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Label}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Padding" Value="5" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Label}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="True">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveGlyphKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Window}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Window}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <AdornerDecorator>
                            <ContentPresenter Content="{TemplateBinding Content}"
                                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </AdornerDecorator>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Window}">
                            <Border Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                                <Grid>
                                    <AdornerDecorator>
                                        <ContentPresenter Content="{TemplateBinding Content}"
                                                          ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                          ContentTemplate="{TemplateBinding ContentTemplate}" />
                                    </AdornerDecorator>
                                    <ResizeGrip x:Name="WindowResizeGrip"
                                                HorizontalAlignment="Right"
                                                VerticalAlignment="Bottom"
                                                IsTabStop="False"
                                                Visibility="Collapsed" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
                                        <Condition Property="WindowState" Value="Normal" />
                                    </MultiTrigger.Conditions>
                                    <Setter TargetName="WindowResizeGrip" Property="Visibility" Value="Visible" />
                                </MultiTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="AllowDrop" Value="True" />
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border x:Name="border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="True">
                        <ScrollViewer x:Name="PART_ContentHost"
                                      Focusable="False"
                                      HorizontalScrollBarVisibility="Hidden"
                                      VerticalScrollBarVisibility="Hidden" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Opacity" Value="0.56" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonHoverActiveBorderKey}}" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.PanelBorderKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsInactiveSelectionHighlightEnabled" Value="True" />
                    <Condition Property="IsSelectionActive" Value="False" />
                </MultiTrigger.Conditions>
                <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type DataGrid}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="BorderThickness" Value="4" />
        <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="True" />
        <Setter Property="ScrollViewer.PanningMode" Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGrid}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="True">
                        <ScrollViewer x:Name="DG_ScrollViewer"
                                      Focusable="False">
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="*" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Button Width="{Binding CellsPanelHorizontalOffset,
                                                                RelativeSource={RelativeSource FindAncestor,
                                                                                               AncestorLevel=1,
                                                                                               AncestorType={x:Type DataGrid}}}"
                                                Command="ApplicationCommands.SelectAll"
                                                Focusable="False"
                                                Style="{DynamicResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle,
                                                                                              TypeInTargetAssembly={x:Type DataGrid}}}">
                                            <Button.Visibility>
                                                <Binding Path="HeadersVisibility"
                                                         RelativeSource="{RelativeSource FindAncestor,
                                                                                         AncestorLevel=1,
                                                                                         AncestorType={x:Type DataGrid}}">
                                                    <Binding.ConverterParameter>
                                                        <DataGridHeadersVisibility>All</DataGridHeadersVisibility>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </Button.Visibility>
                                        </Button>
                                        <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter"
                                                                        Grid.Column="1">
                                            <DataGridColumnHeadersPresenter.Visibility>
                                                <Binding Path="HeadersVisibility"
                                                         RelativeSource="{RelativeSource FindAncestor,
                                                                                         AncestorLevel=1,
                                                                                         AncestorType={x:Type DataGrid}}">
                                                    <Binding.ConverterParameter>
                                                        <DataGridHeadersVisibility>Column</DataGridHeadersVisibility>
                                                    </Binding.ConverterParameter>
                                                </Binding>
                                            </DataGridColumnHeadersPresenter.Visibility>
                                        </DataGridColumnHeadersPresenter>
                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                                                                Grid.Row="1"
                                                                Grid.ColumnSpan="2"
                                                                CanContentScroll="{TemplateBinding CanContentScroll}"
                                                                CanHorizontallyScroll="False"
                                                                CanVerticallyScroll="False"
                                                                Content="{TemplateBinding Content}"
                                                                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                                ContentTemplate="{TemplateBinding ContentTemplate}" />
                                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                                   Grid.Row="1"
                                                   Grid.Column="2"
                                                   Maximum="{TemplateBinding ScrollableHeight}"
                                                   Orientation="Vertical"
                                                   ViewportSize="{TemplateBinding ViewportHeight}"
                                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                                   Value="{Binding VerticalOffset,
                                                                   Mode=OneWay,
                                                                   RelativeSource={RelativeSource TemplatedParent}}" />
                                        <Grid Grid.Row="2"
                                              Grid.Column="1">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}}" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <ScrollBar x:Name="PART_HorizontalScrollBar"
                                                       Grid.Column="1"
                                                       Maximum="{TemplateBinding ScrollableWidth}"
                                                       Orientation="Horizontal"
                                                       ViewportSize="{TemplateBinding ViewportWidth}"
                                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                                       Value="{Binding HorizontalOffset,
                                                                       Mode=OneWay,
                                                                       RelativeSource={RelativeSource TemplatedParent}}" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="True" />
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="False" />
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="False" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type DataGridColumnHeader}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTabGradientKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.WindowTextKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="Height" Value="30" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                    <Grid>
                        <Themes:DataGridHeaderBorder Background="{TemplateBinding Background}"
                                                     BorderBrush="{TemplateBinding BorderBrush}"
                                                     BorderThickness="{TemplateBinding BorderThickness}"
                                                     IsClickable="{TemplateBinding CanUserSort}"
                                                     IsHovered="{TemplateBinding IsMouseOver}"
                                                     IsPressed="{TemplateBinding IsPressed}"
                                                     Padding="{TemplateBinding Padding}"
                                                     SeparatorBrush="{TemplateBinding SeparatorBrush}"
                                                     SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
                                                     SortDirection="{TemplateBinding SortDirection}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Content="{TemplateBinding Content}"
                                              ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Themes:DataGridHeaderBorder>
                        <Thumb x:Name="PART_LeftHeaderGripper"
                               HorizontalAlignment="Left">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Width" Value="8" />
                                    <Setter Property="Background" Value="Transparent" />
                                    <Setter Property="Cursor" Value="SizeWE" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Background="{TemplateBinding Background}"
                                                        Padding="{TemplateBinding Padding}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                        <Thumb x:Name="PART_RightHeaderGripper"
                               HorizontalAlignment="Right">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Width" Value="8" />
                                    <Setter Property="Background" Value="Transparent" />
                                    <Setter Property="Cursor" Value="SizeWE" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Background="{TemplateBinding Background}"
                                                        Padding="{TemplateBinding Padding}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type DataGridRowHeader}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
                    <Grid>
                        <Themes:DataGridHeaderBorder Background="{TemplateBinding Background}"
                                                     BorderBrush="{TemplateBinding BorderBrush}"
                                                     BorderThickness="{TemplateBinding BorderThickness}"
                                                     IsHovered="{TemplateBinding IsMouseOver}"
                                                     IsPressed="{TemplateBinding IsPressed}"
                                                     IsSelected="{TemplateBinding IsRowSelected}"
                                                     Orientation="Horizontal"
                                                     Padding="{TemplateBinding Padding}"
                                                     SeparatorBrush="{TemplateBinding SeparatorBrush}"
                                                     SeparatorVisibility="{TemplateBinding SeparatorVisibility}">
                            <StackPanel Orientation="Horizontal">
                                <ContentPresenter VerticalAlignment="Center"
                                                  Content="{TemplateBinding Content}"
                                                  ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  RecognizesAccessKey="True"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                <Control SnapsToDevicePixels="False"
                                         Template="{Binding ValidationErrorTemplate,
                                                            RelativeSource={RelativeSource FindAncestor,
                                                                                           AncestorLevel=1,
                                                                                           AncestorType={x:Type DataGridRow}}}">
                                    <Control.Visibility>
                                        <Binding Path="(Validation.HasError)"
                                                 RelativeSource="{RelativeSource FindAncestor,
                                                                                 AncestorLevel=1,
                                                                                 AncestorType={x:Type DataGridRow}}">
                                            <Binding.Converter>
                                                <BooleanToVisibilityConverter />
                                            </Binding.Converter>
                                        </Binding>
                                    </Control.Visibility>
                                </Control>
                            </StackPanel>
                        </Themes:DataGridHeaderBorder>
                        <Thumb x:Name="PART_TopHeaderGripper"
                               VerticalAlignment="Top">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Height" Value="8" />
                                    <Setter Property="Background" Value="Transparent" />
                                    <Setter Property="Cursor" Value="SizeNS" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Background="{TemplateBinding Background}"
                                                        Padding="{TemplateBinding Padding}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                        <Thumb x:Name="PART_BottomHeaderGripper"
                               VerticalAlignment="Bottom">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Height" Value="8" />
                                    <Setter Property="Background" Value="Transparent" />
                                    <Setter Property="Cursor" Value="SizeNS" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Background="{TemplateBinding Background}"
                                                        Padding="{TemplateBinding Padding}" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type DataGridRow}">
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderBrush" Value="Black" /> <!--Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" /-->
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
        <Setter Property="ValidationErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <TextBlock Margin="2,0,0,0"
                               VerticalAlignment="Center"
                               Foreground="Red"
                               Text="!"><Run Text="!" />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridRow}">
                    <Border x:Name="DGR_Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="True">
                        <SelectiveScrollingGrid>
                            <SelectiveScrollingGrid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </SelectiveScrollingGrid.ColumnDefinitions>
                            <SelectiveScrollingGrid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </SelectiveScrollingGrid.RowDefinitions>
                            <DataGridCellsPresenter Grid.Column="1"
                                                    ItemsPanel="{TemplateBinding ItemsPanel}"
                                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            <DataGridDetailsPresenter Grid.Row="1"
                                                      Grid.Column="1"
                                                      Visibility="{TemplateBinding DetailsVisibility}">
                                <SelectiveScrollingGrid.SelectiveScrollingOrientation>
                                    <Binding Path="AreRowDetailsFrozen"
                                             RelativeSource="{RelativeSource FindAncestor,
                                                                             AncestorLevel=1,
                                                                             AncestorType={x:Type DataGrid}}">
                                        <Binding.ConverterParameter>
                                            <SelectiveScrollingOrientation>Vertical</SelectiveScrollingOrientation>
                                        </Binding.ConverterParameter>
                                    </Binding>
                                </SelectiveScrollingGrid.SelectiveScrollingOrientation>
                            </DataGridDetailsPresenter>
                            <DataGridRowHeader Grid.RowSpan="2"
                                               SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                                <DataGridRowHeader.Visibility>
                                    <Binding Path="HeadersVisibility"
                                             RelativeSource="{RelativeSource FindAncestor,
                                                                             AncestorLevel=1,
                                                                             AncestorType={x:Type DataGrid}}">
                                        <Binding.ConverterParameter>
                                            <DataGridHeadersVisibility>Row</DataGridHeadersVisibility>
                                        </Binding.ConverterParameter>
                                    </Binding>
                                </DataGridRowHeader.Visibility>
                            </DataGridRowHeader>
                        </SelectiveScrollingGrid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsNewItem" Value="True">
                <Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type DataGrid}}}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="2"
                                           SnapsToDevicePixels="True"
                                           Stroke="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                                           StrokeDashArray="1 2"
                                           StrokeThickness="1" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonHoverActiveBorderKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid x:Name="templateRoot"
                          Background="Transparent"
                          SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="checkBoxBorder"
                                Margin="1"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid x:Name="markGrid">
                                <Path x:Name="optionMark"
                                      Margin="1"
                                      Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z"
                                      Fill="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                                      Opacity="0"
                                      Stretch="None" />
                                <Rectangle x:Name="indeterminateMark"
                                           Margin="2"
                                           Fill="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                                           Opacity="0" />
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter"
                                          Grid.Column="1"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Content="{TemplateBinding Content}"
                                          ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Focusable="False"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0"
                                                               SnapsToDevicePixels="True"
                                                               Stroke="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                                                               StrokeDashArray="1 2"
                                                               StrokeThickness="1" />
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Padding" Value="4,-1,0,0" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="checkBoxBorder" Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
                            <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonHoverActiveBorderKey}}" />
                            <Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"/>
                            <Setter TargetName="indeterminateMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.PanelGradientLightKey}}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="checkBoxBorder" Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveKey}}" />
                            <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveBorderKey}}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.GrayTextKey}}"></Setter>
                            <Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonInactiveGlyphKey}}" />
                            <Setter TargetName="indeterminateMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.SideBarGradientLightKey}}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="checkBoxBorder" Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}" />
                            <Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
                            <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowButtonDownKey}}" />
                            <Setter TargetName="indeterminateMark" Property="Fill" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolboxGradientLightKey}}" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
                            <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="optionMark" Property="Opacity" Value="0" />
                            <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!--  Control Defaults Window Styling  -->
    <Style x:Key="myHeaderStyle"
           TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBorderKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}" />
        <Setter Property="Background" Value="{DynamicResource {x:Static vsfx:VsBrushes.ToolboxHeadingGradientKey}}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
    </Style>

    <SolidColorBrush x:Key="SeeThrough" />

    <DataTemplate x:Key="PropertyNameCellTemplate">
        <TextBlock Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                   Text="{Binding PropertyName}" />
    </DataTemplate>

    <DataTemplate x:Key="PropertyValueCellTemplate">
        <TextBlock Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}"
                   Text="{Binding PropertyValue}" />
    </DataTemplate>

    <DataTemplate x:Key="DeleteCellTemplate">
        <Button HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Content="X" Command="Delete" />
    </DataTemplate>


</ResourceDictionary>